﻿using System;
using App_Code.Common;

namespace App_Code.Objects
{
    /// <summary>
    /// Summary description for VCConnection
    /// </summary>
    public class VCConnection : ConnectionProfileDTO
    {
        #region Properties

        public bool Connected { get; set; }

        public string UserServerId { get; set; }

        #endregion

        #region Constructors
        public VCConnection(string host, string username, string password, int? port, bool isLocalServer, bool useCompression)
        {
            Host = host;
            Username = String.IsNullOrEmpty(username) ? Constants.VC_CONNECTION_DEFAULT_USER : username;
            Password = password;
            Port = port ?? Constants.VC_CONNECTION_DEFAULT_PORT;
            IsLocalServer = isLocalServer;
            UseCompression = useCompression;
        }

        public VCConnection(ConnectionProfileDTO conn)
        {
            Host = conn.Host;
            Username = conn.Username;
            Password = conn.Password;
            Port = conn.Port;
            IsLocalServer = conn.IsLocalServer;
            UseCompression = conn.UseCompression;
            Id = conn.Id;
        }

        #endregion
    }
}